import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)/*启用路由功能*/

const routes = [
    /*路由地址只有一个斜线(/)的时候，这个路由一定放在规则数组的第一项*/
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => {
      return import("../views/AboutView")
    }
  },{
    path: "/info",
    name:"info",
    component: () => import("../views/InfoView")
  },{
    path:"/xinwen",
    name:"liudehua",
    component: ()=>import("../views/NewsView")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
